﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Workflow.Activities;
using CommonLibrary.DataModel.WorkFlow;
using CommonLibrary.Common;
using System.Transactions;
using CommonLibrary.DataModel.Basic;
using CommonLibrary.Wf.Common;

namespace CommonLibrary.Wf.InterFace
{
    [ExternalDataExchange]
    public interface IBILLService
    {
        /// <summary>
        /// 通知
        /// </summary>
        void Info2Next(Guid instanceID, UserEntity fqrxx, ChoiceClrxx clrxx,
            string taskName, object wivList);

        /// <summary>
        /// 打回重新修改
        /// </summary>
        event EventHandler<ReceivedEventArgs> BillUpdated;
        /// <summary>
        /// 向下流转
        /// </summary>
        event EventHandler<ReceivedEventArgs> BillNext;
        /// <summary>
        /// 结束工作流
        /// </summary>
        event EventHandler<ReceivedEventArgs> BillCanceled;
        /// <summary>
        /// 等待
        /// </summary>
        event EventHandler<ReceivedEventArgs> BillWait;
        /// <summary>
        /// 加签
        /// </summary>
        event EventHandler<ReceivedEventArgs> BillInsert;
    }


    [Serializable]
    public class ReceivedEventArgs : ExternalDataEventArgs
    {
        public UserEntity Fqrxx { get; set; }
        public int[] Clrxxs { get; set; }
        public string TaskName { get; set; }
        public List<WfInsvalueEntity> WivList { get; set; }

        public ReceivedEventArgs(Guid instanceID, UserEntity fqrxx, int[] clrxxs, string taskName, List<WfInsvalueEntity> wivList)
            : base(instanceID)
        {
            if (fqrxx != null)
                Fqrxx = fqrxx;
            if (clrxxs != null)
                Clrxxs = clrxxs;
            TaskName = taskName;
            WivList = wivList;
        }

    }

    //[Serializable]
    //public class BillModel
    //{
    //    string _userName;
    //    /// <summary>
    //    /// 报销人
    //    /// </summary>
    //    public string UserName
    //    {
    //        get { return _userName; }
    //        set { _userName = value; }
    //    }

    //    public int UserID { get; set; }

    //    string _billId;
    //    /// <summary>
    //    /// 报销编号，数据库里的
    //    /// </summary>
    //    public string BillId
    //    {
    //        get { return _billId; }
    //        set { _billId = value; }
    //    }

    //    decimal _money;
    //    /// <summary>
    //    /// 报销金额
    //    /// </summary>
    //    public decimal Money
    //    {
    //        get { return _money; }
    //        set { _money = value; }
    //    }

    //    private string fremark;
    //    /// <summary>
    //    /// 财务批示
    //    /// </summary>
    //    public string Fremark
    //    {
    //        get { return fremark; }
    //        set { fremark = value; }
    //    }

    //    private string bremark;
    //    /// <summary>
    //    /// 老板批示
    //    /// </summary>
    //    public string Bremark
    //    {
    //        get { return bremark; }
    //        set { bremark = value; }
    //    }

    //    private string premark;
    //    /// <summary>
    //    /// 出纳批示
    //    /// </summary>
    //    public string Premark
    //    {
    //        get { return premark; }
    //        set { premark = value; }
    //    }

    //    private string lastRemark;
    //    /// <summary>
    //    /// 最后批示
    //    /// </summary>
    //    public string LastRemark
    //    {
    //        get { return lastRemark; }
    //        set { lastRemark = value; }
    //    }

    //}

    /// <summary>
    /// 工作的处理者类型
    /// </summary>
    public enum TaskClrType
    {
        按人员,//int[] 编码组 '1,2,3,'
        按权限,//string[]
        发起人,
        由上一步处理人指定
    }
}